import request from '@/utils/request'
import { encryptionData } from '@/utils/com'
import Qs from 'qs'

// 获取省数据
export function getProvince() {
  return request({
    url: `/jcdPub/sysArea/getProvList`,
    method: 'get'
  })
}

// 获取市数据
export function getCity(id) {
  return request({
    url: `/jcdPub/sysArea/getCityListByProvId/${id}`,
    method: 'get'
  })
}

// 获取区数据
export function getArea(id) {
  return request({
    url: `/jcdPub/sysArea/getAreaByCityId/${id}`,
    method: 'get',
    headers: encryptionData({}, `/sysArea/getAreaByCityId/${id}`)
  })
}


/* 获取会员用户列表信息 */
export function getUserList(data) {
  return request({
    url: '/jcdGys/register/page',
    method: 'get',
    headers: encryptionData(data, '/register/page'),
    params: data
  })
}

/* 品牌商信息-获取托管账号列表 */
export function getTgList(data) {
  return request({
    url: '/jcdGys/merchant/selectTgUser',
    method: 'get',
    headers: encryptionData(data, '/merchant/selectTgUser'),
    params: data
  })
}

/* 获取品牌列表 */
export function getBrandList(data) {
  return request({
    url: '/jcdGys/getBrandList',
    method: 'get',
    headers: encryptionData(data, '/getBrandList'),
    params: data
  })
}

/* 获取品牌商列表 */
export function getDealerList(data) {
  return request({
    url: '/jcdGys/getDealerList',
    method: 'get',
    headers: encryptionData(data, '/getDealerList'),
    params: data
  })
}

/* 产品分类-列表 */
export function getProductType(data) {
  return request({
    url: '/jcdGys/materialsCategory/list',
    method: 'get',
    headers: encryptionData(data, '/materialsCategory/list'),
    params: data
  })
}
/* 类型管理产品分类-列表 */
export function getCategoryList(data) {
  return request({
    url: '/jcdGys/materialsCategory/categoryList',
    method: 'get',
    headers: encryptionData(data, '/materialsCategory/categoryList'),
    params: data
  })
}
